import { createApp } from 'vue';
// import VueRouter from 'vue-router';
import App from '../App.vue';
import { createRouter, createWebHashHistory } from 'vue-router';
const app = createApp(App);
// app.use(VueRouter);

// import header from '../views/header.vue';
import content from '../views/content.vue'
const routes = [
  {
    path: '/content',
    component: content
  },
  // {
  //     path: "*",
  //     redirect: "/content"
  // }
];
const router = createRouter({
  history: createWebHashHistory(),
  // history: createWebHistory(),
  routes
});

export default router;
//重写push和replace
// let originPush = VueRouter.prototype.push;
// let originReplace = VueRouter.prototype.replace;

// VueRouter.prototype.push = function (location, resolve, reject) {
//     if (resolve && reject) {
//         originPush.call(this, location, resolve, reject);
//     } else {
//         originPush.call(this, location, () => { }, () => { });
//     }
// }

// VueRouter.prototype.replace = function (location, resole, reject) {
//     if (resole && reject) {
//         originReplace.call(this, location, resole, reject);
//     } else {
//         originReplace.call(this, location, () => { }, () => { });
//     }
// }

// // import mdToHtml from '../components/mdToHtml.vue';

// const routes = [
//     {
//         path: "/mdToHtml",
//         name: "mdToHtml",
//         component: () => import("../components/mdToHeml.vue")
//     },
//     {
//         path: "/firstArtical",
//         name: "firstArtical",
//         component: () => import("../components/articalShow/firstArtical.vue")
//     }
// ]

// const router = createRouter({
//     history: createWebHashHistory(),
//     // history: createWebHistory(),
//     routes
// });

// export default router;
